package org.whh.sys.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.whh.base.util.QueryVo;
import org.whh.base.util.ResultDTO;
import org.whh.sys.domain.Dictionary;
import org.whh.sys.domain.Dictionaryitem;
import org.whh.sys.mapper.DictionaryitemMapper;
import org.whh.sys.service.IDictionaryitemService;
import org.whh.base.service.impl.BaseServiceImpl;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author whh
 * @since 2023-03-13
 */
@Service
public class DictionaryitemServiceImpl extends BaseServiceImpl<Dictionaryitem> implements IDictionaryitemService {

    @Autowired
    DictionaryitemMapper dictionaryitemMapper;

    @Override
    public ResultDTO<Dictionaryitem> getAllPage(QueryVo queryVo) {
        int total = dictionaryitemMapper.getTotal(queryVo);
        ResultDTO<Dictionaryitem> resultDTO=new ResultDTO<>();
        if(total>0) {
            List<Dictionaryitem> mlist = dictionaryitemMapper.getAllPage(queryVo);
            resultDTO.setPageList(mlist);
            resultDTO.setTotal(total);
        }
        return resultDTO;
    }
}
